<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('用户反馈列表')" />
    <th:block th:include="include :: select2-css" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>用户ID：</label>
                                <input type="text" name="uid"/>
                            </li>
                            <li>
                                <label>手机号：</label>
                                <input type="text" name="mobile"/>
                            </li>
                            <li>
                                <label>状态：</label>
                                <div class="col-sm-2" >
                                    <select class="form-control" name="status">
                                        <option value="">所有</option>
                                        <option value="1">已处理</option>
                                        <option value="0">未处理</option>
                                    </select>
                                </div>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

<!--            <div class="btn-group-sm" id="toolbar" role="group">-->
<!--                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="member:feedback:add">-->
<!--                    <i class="fa fa-plus"></i> 添加-->
<!--                </a>-->
<!--                <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="member:feedback:edit">-->
<!--                    <i class="fa fa-edit"></i> 修改-->
<!--                </a>-->
<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="member:feedback:remove">-->
<!--                    <i class="fa fa-remove"></i> 删除-->
<!--                </a>-->
<!--                <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="member:feedback:export">-->
<!--                    <i class="fa fa-download"></i> 导出-->
<!--                </a>-->
<!--            </div>-->
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
     <th:block th:include="include :: select2-js" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('member:feedback:edit')}]];
        var removeFlag = [[${@permission.hasPermi('member:feedback:remove')}]];
        var prefix = ctx + "member/feedback";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "用户反馈",
                columns: [
                //     {
                //     checkbox: true
                // },
                // {
                //     field: 'id',
                //     title: '',
                //     visible: false
                // },
                {
                    field: 'uid',
                    title: '用户ID'
                },
                    {
                        field: 'mobile',
                        title: '手机号'
                    },
                    {
                        field: 'channelCode',
                        title: '注册渠道',
                        formatter: function (value,row,index){
                            return row.channelCode + ' | ' + row.channelName;
                        }
                    },
                    {
                        field: 'reqChannelCode',
                        title: '请求渠道',
                        formatter: function (value,row,index){
                            return row.reqChannelCode + ' | ' + row.reqChannelName;
                        }
                    },
                {
                    field: 'content',
                    title: '内容',
                    formatter: function(value, row, index) {
                        return $.table.tooltip(value);
                    }
                },
                    {
                        field: 'status',
                        title: '状态',
                        formatter: function (value,row,index){
                            return row.status==1?'<span class="badge badge-primary">已处理</span>':'<span class="badge badge-danger">未处理</span>';
                        }
                    },
                    {
                        field: 'result',
                        title: '处理结果',
                        formatter: function(value, row, index) {
                            return $.table.tooltip(value);
                        }
                    }
                    ,
                    {
                        field: 'createTime',
                        title: '投诉时间'
                    }
                ,
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
                        return actions.join('');
                    }
                }
                ]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>